package com.youxue.service;

import com.youxue.dao.UserClassMapper;
import com.youxue.entity.UserClass;
import com.youxue.entity.UserClassKey;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by 15c on 2018/1/27.
 */
@Service("userClass")
public class UserClassServiceImpl implements UserClassService {

    @Autowired
    UserClassMapper userClassMapper;

    @Override
    public int addAUserClass(UserClass userClass) {
        return userClassMapper.insertSelective(userClass);
    }

    @Override
    public int reviseAUserClass(UserClassKey userClassKey) {
        return userClassMapper.deleteAUserClass(userClassKey);
    }

    @Override
    public List<UserClass> showAUserClass(Integer userId) {
        return userClassMapper.selectAUserAllClass(userId);
    }

    @Override
    public int showAClassCount(Integer classId) {
        return 0;
    }

    @Override
    public UserClass showAUserClassInfo(UserClassKey userClassKey) {
        return userClassMapper.selectByPrimaryKey(userClassKey);
    }
}
